package cn.javase.base.io._04_数据流;

import java.io.*;

public class _数据流测试 {
    public static void main(String[] args) throws Exception {

        String path = "D:\\Code\\study\\JavaCode\\JavaSEDemo\\base\\src\\main\\java\\cn\\javase\\base\\io\\_04_数据流\\1.txt";

        DataOutputStream dos = new DataOutputStream(new FileOutputStream(path));
        int a = 10;
        double b = 3.144;
        dos.writeInt(a);
        dos.writeDouble(b);
        dos.flush();
        dos.close();

        DataInputStream dis = new DataInputStream(new FileInputStream(path));
        System.out.println(dis.readInt());
        System.out.println(dis.readDouble());
        dis.close();

    }
}
